package com.llu.feign;

import com.llu.feign.imp.BookFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;


@FeignClient(value = "bookservice", fallback = BookFeignClientFallback.class)
public interface BookFeignClient {
    // 通过bid 查询书本
    @RequestMapping("/book/{bid}")
    com.llu.entity.Book getBookById(@PathVariable("bid") int bid);

    // 查询书本是否可借
    @GetMapping("/book/borrow/{bid}")
    boolean bookBorrow(@PathVariable("bid") int bid);

    // 查询书本剩余数量
    @GetMapping("/book/remain/{bid}")
    int bookRemain(@PathVariable("bid") int bid);


}
